home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
fortran
/
fv121s.zip
/
FAT2.DOC
< prev
next >
Wrap
Text File
|
1988-06-04
|
12KB
|
370 lines
APR 1988 FAT-VIDEO 1.21 POKEB Page V-24
POKEB(OFF,SEG,VAL) - Put BYTE in memory location SEG:OFF
Usage:
call pokeb(off,seg,val)
integer*2 off,seg or integer*4 off,seg
integer*2 val
inputs: off,seg,val
returns: none
MS-Fortran 4.0 Large Model
Description:
This routine pokes the lower byte of VAL into the byte
defined by seg:off.
This function must be passed an integer*2 for VAL,
and an integer*2 or integer*4 for off and seg. If off and/or
seg is passed as an integer*4, only the lower word is altered.
Seg and off must be declared as integer*4 if they exceed +32k
or -32k, as this is the largest integer*2 value Fortran can
assign. That is if you explicitly declare seg=#B800 (hexadecimal
cga screen address), then seg must be declared as integer*4 or
else the compiler will assign a negative value to seg. In general,
just declare any seg definitions as integer*4. Note: If a
video function returns a segment address for later use it may be
declared integer*2 in all cases, as the video functions treat
integer*2 values as 0 through +64k (unsigned integers).
See also peekb(), peekw(), pokew(), allmem(), fremem().
Off = offset
Seg = segment paragraph
Val = returned
CGA, Mono, EGA
APR 1988 FAT-VIDEO 1.21 POKEW Page V-25
POKEW(OFF,SEG,VAL) - Put WORD in memory location SEG:OFF
Usage:
call pokew(off,seg,val)
integer*2 off,seg or integer*4 off,seg
integer*2 val
inputs: off,seg,val
returns: none
MS-Fortran 4.0 Large Model
Description:
This routine pokes VAL into the word at the location seg:off.
This function must be passed an integer for VAL and may be
passed an integer*2 or integer*4 for off and seg. If off
and/or seg is passed as an integer*4, only the lower word is
altered. Seg and off must be declared as integer*4 if they exceed
+32k or -32k, as this is the largest integer*2 value Fortran can
assign. That is, if you explicitly declare seg=#B800 (hexadecimal
cga screen address), then seg must be declared as integer*4, or
else the compiler will assign a negative value to seg. In general,
just declare any seg definitions as integer*4. Note: If a video
function returns a segment address for later use, it may be
declared integer*2 in all cases as the video functions treat
integer*2 values as 0 through +64k (unsigned integers).
See also peekb(), peekw(), pokeb(), allmem(), fremem().
Off = offset
Seg = segment paragraph
val = returned
Int none
CGA, Mono, EGA
APR 1988 FAT-VIDEO 1.21 MEMSTR Page V-26
MEMSTR(OFF,SEG,STRING,NBYTES) - Copy Memory to a String.
Usage:
call memstr(OFF,SEG,STRING,NBYTES)
integer*2 off,seg,nbytes or integer*4 off,seg,nbytes
character*n string
inputs: off,seg,nbytes
returns: string
MS-Fortran-4.0-Large Dos 2.0
Description:
This routine copies memory (by bytes) starting at seg:off, to a
character string. Such as screen memory to a buffer.
See also StrMem(),Peekb(),Peekw(),Pokeb(),Pokew()
OFF = offset (0-64k)
SEG = paragraph segment
STRING = buffer
NBYTES = # bytes to copy, max = 32K
Int none
CGA, Mono, EGA
APR 1988 FAT-VIDEO 1.21 STRMEM Page V-27
STRMEM(OFF,SEG,STRING,NBYTES) - Copies a String to Memory.
Usage:
call strmem(OFF,SEG,STRING,NBYTES)
integer*2 off,seg,nbytes or integer*4 off,seg,nbytes
character*n string
inputs: off,seg,string,nbytes
returns: none
MS-Fortran-4.0 - Large Dos 2.0
Description:
This routine copies bytes from the string to memory at seg:off.
Such as a string buffer to the screen memory.
See also MemStr(),Peekb(),Peekw(),Pokeb(),Pokew()
OFF = offset (0-64k)
SEG = paragraph segment
STRING = buffer
NBYTES = # bytes to copy, max = 32k
Int none
CGA, Mono, EGA
APR 1988 FAT-VIDEO 1.21 GETVID Page V-28
GETVID(NRS,NCS,NRE,NCE,SEG) - Copy Screen to memory at SEG.
Usage:
call getvid(nrs,ncs,nre,nce,seg)
integer*2 nrs,ncs
integer*2 nre,nce
integer*2 seg or integer*4 seg
inputs: nrs,ncs,nre,nce,seg
returns: none
MS-Fortran 4.0 Large Model
Description:
This subroutine saves the window section defined by nrs,ncs
and nre,nce into the memory location starting at seg. It is up
to the calling program to allocate storage, via ALLMEM().
This routine stores the video buffer character and attribute
bytes for the window defined, into the buffer starting at seg.
The Rom-Bios read attribute and character at the cursor routine
is used. This should be compatible if your Rom-Bios is compatable.
This is slower than using GETCGA, or GETMON.
This function does not clear the window after saving it, but
once saved you may do anything to the window area, and restore
the saved window contents using PUTVID().
nrs = first row of window
ncs = first col of window
nre = last row of window
nce = last col of window
seg = segment of allocated memory, as output from ALLMEM().
Note: To calcualte the number of paragraphs to request from ALLMEM()
calculate the following:
Npar= (((nr*nc)*2)+15)/16 ; nr=nre-nrs+1, nc=nce=ncs+1
Example:
Npar= (((11*41)*2)+15)/16
call ALLMEM(Npar,SEG,MaxPar)
if(SEG.eq.7 .or. SEG.eq.8)Go To 1000 ;Error !
call GETVID(0,0,10,40,SEG)
See Wopen(),Wclose().
Int 10h, fx 08h
CGA, Mono, EGA
APR 1988 FAT-VIDEO 1.21 PUTVID Page V-29
PUTVID(NRS,NCS,NRE,NCE,SEG) - Copy memory at SEG to Screen.
Usage:
call putvid(nrs,ncs,nre,nce,seg)
integer*2 nrs,ncs
integer*2 nre,nce
integer*2 seg or integer*4 seg
inputs: nrs,ncs,nre,nce,seg
returns: none
MS-Fortran 4.0 Large Model
Description:
This subroutine restores the window section defined by nrs,ncs
and nre,nce onto the screen. It is up to the calling program to
free storage via FREMEM(). This routine restores the video
buffer, character bytes, and attribute bytes for the window
defined.
The Rom-Bios write attribute and byte at the cursor routine is
used. Therefore, this should be compatible if your Rom-Bios is
compatible. This is slower than putcga and putmon, though.
This will over write the current screen contents in the window
defined, with the contents in the buffer at SEG.
nrs = first row of window
ncs = first col of window
nre = last row of window
nce = last col of window
Seg = segmen address used in GETVID()
Example:
call PUTVID(0,0,10,40,seg)
call FREMEM(Seg,Ier)
if(Ier.ne.0)Go To 1000 ; Error !
See Wopen(),Wclose()
Int 10h, fx-09h
CGA, Mo